﻿package _Content{
	import flash.display.Stage;
	import flash.events.Event
	import flash.events.KeyboardEvent;
	import flash.events.MouseEvent


	public class key_control {

		private var keyobj:Object = new Object
		private var _stage=Stage

		public function key_control() {

		}
		public function init(temp_stage){
            _stage=temp_stage;
			_stage.addEventListener("keyDown", keydownHandler);
			_stage.addEventListener("keyUp", keyupHandler);
		}
        public function isDown(key) {
			return keyobj[key]?true:false;
		}
		private function keydownHandler(evt:KeyboardEvent) {
			keyobj[evt.keyCode] = true;
		}

		private function keyupHandler(evt:KeyboardEvent) {
			delete keyobj[evt.keyCode];
			
        }
	

	}
}